from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks
from modelscope import snapshot_download

# # 模型下载地址
model_dir = snapshot_download("iic/nlp_gpt3_text-generation_chinese-large")
print(model_dir)

# # 加载模型
text_generation_zh = pipeline(Tasks.text_generation, model=model_dir)

# # 输入文本
# text = "你好，我想订一张去北京的机票"
# text = "你好，帮我想想，AGV有哪些算法"
# result_zh = text_generation_zh(text)
# print(result_zh['text'])
while True:
    text = input("请输入：")
    result_zh = text_generation_zh(text)
    print(result_zh['text'])
